package com.zeta.system.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.*;
import org.zetaframework.base.entity.SuperEntity;

import java.io.Serial;


/**
 * 用户角色
 *
 * @author AutoGenerator
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Schema(description = "用户角色")
@TableName("sys_user_role")
public class SysUserRole extends SuperEntity<Long> {

    @Serial
    private static final long serialVersionUID = 1L;

    /** 用户id */
    @Schema(description = "用户id", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "用户id不能为空")
    @TableField(value = "user_id")
    private Long userId;

    /** 角色id */
    @Schema(description = "角色id", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "角色id不能为空")
    @TableField(value = "role_id")
    private Long roleId;
}
